package com.auction.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Order implements Serializable {

    private Long id; // 订单ID

    private Long auctionId; // 拍卖品ID

    private Long buyerId; // 买家ID

    private Long sellerId; // 卖家ID

    private String number; // 订单编号

    private BigDecimal orderAmount; // 订单金额

    private Integer orderStatus; // 订单状态（0:待支付, 1:已支付, 2:已发货, 3:已完成, 4:已取消)

    private String paymentMethod; // 支付方式

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime paymentTime; // 支付时间

    private Long shippingAddressId; // 收货地址ID

    private String trackingNumber; // 物流单号

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime; // 创建时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime; // 更新时间
}